import { defineAmisPlugin, getBaseFormItem, getOptionsTpl } from '../../base/util';
import component from './fc';
import type { IProps } from './interface';

export default defineAmisPlugin<IProps>(() => {
    return {
        component,
        options: getBaseFormItem({
            type: 'radio-group', order: -6983, name: '单选框', icon: 'AimOutlined',xtype:'RadioGroup',
            tpls: [
                {
                    label: '待选项',
                    mode: 'horizontal',
                    type: 'input-sub-form',
                    name: 'data',
                    multiple: true,
                    addable: true,
                    removable: true,
                    btnLabel: '${label}',
                    minLength: 1,
                    draggable: true,
                    form: {
                      title: '设置待选项',
                      body: [
                        {
                          type: 'group',
                          direction: 'vertical',
                          body: [
                            {
                              type: 'input-text',
                              name: 'label',
                              label: '选项名称',
                              required: true
                            },
                            {
                              type: 'input-text',
                              name: 'value',
                              label: '选项值',
                              required: true
                            }
                          ]
                        }
                      ]
                    }
                  },
            ]
        })
    };
});
